Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(notifications): style badge 'attention' if unread danger/warn notifications #255

Merged
merged 2 commits into from
Aug 27, 2021

Conversation

andrewazores
Copy link
Member

Fixes #254

If danger/warning level graphical notifications are emitted they are "stored" in the notification drawer, and the notification badge on the masthead is updated to the "attention" (red) variant to call the user's focus. Additionally, these notifications (and only these - not the "lower" levels) will be displayed once again as "toast"-style notifications, as they used to be, to help ensure the user notices them in a timely fashion. Closing the toast will mark the notification as read in the drawer as well, but not remove it.

To test, create a recording on a target. Then attempt to create another recording on the same target and using the same recording name.

@andrewazores andrewazores force-pushed the notification-error-badge branch from a8f789f to 547dec1 Compare August 26, 2021 22:34
@jan-law
Copy link
Contributor

jan-law commented Aug 27, 2021

Looking good!
How can I trigger a warning notification? The danger notifications are working well with the toast notifications.

@andrewazores
Copy link
Member Author

Looking good!
How can I trigger a warning notification? The danger notifications are working well with the toast notifications.

$ ag warning
src/app/CreateRecording/CustomRecordingForm.tsx
144:      notifications.warning('Invalid form data', message);

src/app/RecordingList/ArchiveUploadModal.tsx
81:      notifications.warning('Attempted to submit JFR upload without a file selected');

src/app/SecurityPanel/CertificateUploadModal.tsx
81:        notifications.warning('File format is not compatible');
85:      notifications.warning('Attempted to submit certificate upload without a file selected');
90:        notifications.warning('File format is not compatible');

Probably the easiest way is to go to Security and try to upload something that isn't a certificate. I tried uploading a PNG and saw a warning toast.

@andrewazores andrewazores merged commit 95f7d9d into cryostatio:main Aug 27, 2021
@andrewazores andrewazores deleted the notification-error-badge branch August 27, 2021 16:14
This was referenced Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error-level notifications should update badge accordingly
2 participants